package hy.controller;

import hy.service.DeptClientService;
import hy.entity.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ConsumerFeignCtrl {

    @Autowired
    DeptClientService service;

    @RequestMapping("/consumerFeign/dept/get/{id}")
    public Dept get(@PathVariable("id")Integer id){
        return service.get(id);
    }

    //浏览器中：localhost/consumerFeign/dept/list
    @RequestMapping("/consumerFeign/dept/list")
    public List<Dept> list(){
        return service.list();
    }


}
